package com.ruoyi.graph.service.impl;

import com.ruoyi.graph.dao.RelationshipDao;
import com.ruoyi.graph.domain.Relationship;
import com.ruoyi.graph.service.TableRelationshipService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Slf4j
@Service
public class TableRelationshipServiceImpl implements TableRelationshipService {

    @Autowired
    private RelationshipDao relationshipDao;

    @Override
    public Relationship createRelationship(long sourceId, long targetId, String ship) {

        Relationship relation = relationshipDao.createRelationShip(sourceId,targetId,ship);
        return relation;
    }

    @Override
    public void deleteRelationship(long sourceId, long targetId, String ship) {
        relationshipDao.deleteRelationship(sourceId,targetId);
    }
}
